﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="details.aspx.vb" Inherits="HausaMathTermdev.details" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource3">
        <Series>
            <asp:Series Name="Series1" YValuesPerPoint="2" XValueMember="Mathterm" 
                YValueMembers="LikeCount" ChartType="Bar">
            </asp:Series>
        </Series>
        <ChartAreas>
            <asp:ChartArea Name="ChartArea1">
            </asp:ChartArea>
        </ChartAreas>
    </asp:Chart>

    <asp:SqlDataSource ID="SqlDataSource3" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
    SelectCommand="SELECT [LikeCount], [Mathterm], [TermID] FROM [CountLikes]"></asp:SqlDataSource>

    <br />

    <asp:DetailsView ID="DetailsView1" runat="server" DataSourceID="SqlDataSource1" 
            Height="50px" AutoGenerateRows="False" Width="100%" CellPadding="4" 
        ForeColor="#333333" GridLines="None">
           <AlternatingRowStyle BackColor="White" />
           <CommandRowStyle BackColor="#D1DDF1" Font-Bold="True" />
           <EditRowStyle BackColor="#2461BF" />
           <FieldHeaderStyle BackColor="#DEE8F5" Font-Bold="True" />
           <Fields>
                <asp:BoundField DataField="Mathterm" HeaderText="Mathterm" 
                    SortExpression="Mathterm" />
                <asp:BoundField DataField="Hausaterm" HeaderText="Hausaterm" 
                    SortExpression="Hausaterm" />
                <asp:ImageField DataAlternateTextField="PictureSymbol" 
                    DataImageUrlField="PictureSymbol" DataImageUrlFormatString="/image/{0}" 
                    HeaderText="Illustration Picture">
                    <HeaderStyle Width="20%" />
                    <ItemStyle CssClass="IllustartionPicture" />
                </asp:ImageField>
                <asp:BoundField DataField="Definition" HeaderText="Definition" 
                    SortExpression="Definition" />
                <asp:HyperLinkField DataNavigateUrlFields="SiteAdd" 
                DataNavigateUrlFormatString="{0}" 
                 HeaderText=" site " SortExpression="SiteAdd" 
                    Text="Click here"  />
                <asp:BoundField DataField="Remark" HeaderText="Remark" 
                    SortExpression="Remark" />
                <asp:BoundField DataField="Category" HeaderText="Category" 
                    SortExpression="Category" />
                <asp:BoundField DataField="Author" HeaderText="Author" 
                    SortExpression="Author" />
                <asp:BoundField DataField="DDate" HeaderText="DDate" 
                    SortExpression="DDate" />
            </Fields>
           <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
           <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
           <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
           <RowStyle BackColor="#EFF3FB" />
    </asp:DetailsView>

    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [TermID], [Mathterm], [Hausaterm], [PictureSymbol], [Definition], [SiteAdd], [Remark],[Category], [Author], [DDate] FROM [Terms] WHERE ([TermID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="TermID" QueryStringField="TermID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ID" DataSourceID="SqlDataSource2" Width="100%">
        <Columns>
            <asp:BoundField DataField="Ctext" HeaderText="Ctext" SortExpression="Ctext" />
            <asp:BoundField DataField="CTitle" HeaderText="CTitle" 
                SortExpression="CTitle" />
            <asp:BoundField DataField="UserID" HeaderText="UserID" 
                SortExpression="UserID" />
            <asp:BoundField DataField="AddedDate" HeaderText="AddedDate" 
                SortExpression="AddedDate" />
        </Columns>
    </asp:GridView>

    <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
        ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
        SelectCommand="SELECT [ID], [Ctext], [CTitle], [UserID], [AddedDate], [TermID] FROM [Commentstable] WHERE ([TermID] = ?)">
        <SelectParameters>
            <asp:QueryStringParameter Name="TermID" QueryStringField="TermID" 
                Type="Int32" />
        </SelectParameters>
    </asp:SqlDataSource>

    <asp:Panel ID="Panel1" runat="server">
    <asp:Image ID="IM_Like" ImageUrl="image/Like.jpg" runat="server" Visible="false" />
    <asp:Button ID="Btn_Like" runat="server" Text="Like" />
            <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
            </asp:ToolkitScriptManager>
	            <asp:Rating ID="Rating1" runat="server" 
		            WaitingStarCssClass="WaitingStar" 
		            StarCssClass="Star"
		            FilledStarCssClass="FilledStar" 
		            EmptyStarCssClass="EmptyStar">
                 </asp:Rating>
            <br />
            <br />
            <asp:Button ID="btn_Rate" runat="server" Text="Rate!" />
            <br />
                <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
                    DataSourceID="SqlDataSource" DataTextField="Tag" DataValueField="TagID" 
                    RepeatDirection="Horizontal">
                </asp:CheckBoxList>
                Add commas between tags :<br />
                <asp:TextBox ID="TextBox1" runat="server" Width="378px"></asp:TextBox>
                <asp:SqlDataSource ID="SqlDataSource" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" 
                    SelectCommand="SELECT [TagID], [Tag] FROM [Tags]">
                </asp:SqlDataSource>
                <br />
                <asp:Button ID="AddTag" runat="server" Text="Add Tag" />
                <br />
                <br />
                <br />
    <table style="text-align:center ;" >
        <tr>
            <td colspan="2">
                Add Comment
            </td>
        </tr>
        <tr>
            <td >
                Title:
            </td>
            <td >
                <asp:TextBox ID="TB_Title" runat="server" MaxLength="255" Width="300px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td >
                Text:
            </td>
            <td >
                <asp:TextBox ID="TB_Comment" runat="server" Height="100px" TextMode="MultiLine" 
                    Width="300px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center">
                <asp:Button ID="btn_submit" runat="server" Text="Add Comment" Width="172px" 
                     />
            </td>
        </tr>
    </table>
    </asp:Panel> 


</asp:Content>
